﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.TeamFoundation.MVVM;
using System.Windows.Input;

namespace Toybox.NicoSharp.Controls.Url
{
	partial class UrlControl
	{
		public class ViewModel : ValidatingViewModelBase
		{
			#region [Binding]

			/// <summary>
			/// 接続ボタン
			/// </summary>
			public String ButtonText
			{
				get { return this._buttonText; }
				set
				{
					if (value == this._buttonText) return;

					this._buttonText = value;
					this.RaisePropertyChanged("ButtonText");
				}
			}
			private String _buttonText;

			/// <summary>
			/// 接続先Url
			/// </summary>
			public Uri Url
			{
				get { return this._url; }
				set
				{
					if (value == this._url) return;

					this._url = value;
					this.RaisePropertyChanged("Url");
				}
			}
			private Uri _url;

			/// <summary>
			/// 実行コマンド
			/// </summary>
			public ICommand RunCommand
			{
				get
				{
					return this._runCommand
						?? (this._runCommand = new RelayCommand(
							(object obj) =>
							{
								Console.WriteLine("run");
							},
							(object obj) =>
							{
								return true;
							}));
				}
			}
			private ICommand _runCommand;

			#endregion [Binding]


		}
	}
}
